package com.drinks.yiniang.entity.goods;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.drinks.yiniang.entity.comment.BannerEntity;
import com.drinks.yiniang.entity.comment.GoodsCommentJson;
import com.hansen.library.entity.BaseJson;

import java.io.Serializable;
import java.util.List;

/**
 * @author han
 * @date 2019/11/7
 */
public class GoodsDetailJson extends BaseJson {

    public static final int ITEM_TYPE_GOODS_COMMENT = 0x01;//评论
    public static final int ITEM_TYPE_GOODS_WEB = 0x02;//富文本
    public static final int ITEM_TYPE_GOODS_RECOMMENT_TITLE = 0x03;//推荐标题
    public static final int ITEM_TYPE_GOODS_RECOMMENT_LIST = 0x04;//推荐商品列表

    private GoodsDetailData data;

    public GoodsDetailData getData() {
        return data;
    }

    public void setData(GoodsDetailData data) {
        this.data = data;
    }

    public static class GoodsDetailData {
        private String id;
        private String name;
        private String en_name;
        private String sub_title;
        private String recommend_reason;
        //是否预售 0否 1是
        private String is_forword_sale;
        //商品编码
        private String product_code;
        //包装方式
        private String pack_method;
        //单品容量
        private String single_capacity;
        //价格
        private String app_price;
        //酒精度
        private String alcohol;
        //麦芽度
        private String wort;
        //是否收藏
        private String is_collect;
        //附属信息
        private GoodsDetailAttach attach;
        //描述(富文本)
        private String description;
        //规格名称
        private List<String> sku_names;
        //规格值
        private List<String> sku_values;
        //商品图片
        private List<String> goods_images;
        //标签数组
        private List<String> goods_label;
        //活动价格
        private String activity_price;
        //是否显示活动对比价 0不显示 其他显示
        private String is_show_contrast;
        //活动信息列表
        private List<GoodsDetailActivity> activity;
        //库存
        private String stock;
        //banner
        private BannerEntity banner;
        //规格规则
        private List<GoodsDetailSku> sku;
        //自定义商品参数列表
        private List<GoodsDetailParams> params;
        //评论总数
        private String comment_count;
        private GoodsDetailComments comment;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getEn_name() {
            return en_name;
        }

        public void setEn_name(String en_name) {
            this.en_name = en_name;
        }

        public String getSub_title() {
            return sub_title;
        }

        public void setSub_title(String sub_title) {
            this.sub_title = sub_title;
        }

        public String getRecommend_reason() {
            return recommend_reason;
        }

        public void setRecommend_reason(String recommend_reason) {
            this.recommend_reason = recommend_reason;
        }

        public String getIs_forword_sale() {
            return is_forword_sale;
        }

        public void setIs_forword_sale(String is_forword_sale) {
            this.is_forword_sale = is_forword_sale;
        }

        public String getProduct_code() {
            return product_code;
        }

        public void setProduct_code(String product_code) {
            this.product_code = product_code;
        }

        public String getPack_method() {
            return pack_method;
        }

        public void setPack_method(String pack_method) {
            this.pack_method = pack_method;
        }

        public String getSingle_capacity() {
            return single_capacity;
        }

        public void setSingle_capacity(String single_capacity) {
            this.single_capacity = single_capacity;
        }

        public String getApp_price() {
            return app_price;
        }

        public void setApp_price(String app_price) {
            this.app_price = app_price;
        }

        public String getAlcohol() {
            return alcohol;
        }

        public void setAlcohol(String alcohol) {
            this.alcohol = alcohol;
        }

        public String getWort() {
            return wort;
        }

        public void setWort(String wort) {
            this.wort = wort;
        }

        public String getIs_collect() {
            return is_collect;
        }

        public void setIs_collect(String is_collect) {
            this.is_collect = is_collect;
        }

        public GoodsDetailAttach getAttach() {
            return attach;
        }

        public void setAttach(GoodsDetailAttach attach) {
            this.attach = attach;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public List<String> getSku_names() {
            return sku_names;
        }

        public void setSku_names(List<String> sku_names) {
            this.sku_names = sku_names;
        }

        public List<String> getSku_values() {
            return sku_values;
        }

        public void setSku_values(List<String> sku_values) {
            this.sku_values = sku_values;
        }

        public List<String> getGoods_images() {
            return goods_images;
        }

        public void setGoods_images(List<String> goods_images) {
            this.goods_images = goods_images;
        }

        public List<String> getGoods_label() {
            return goods_label;
        }

        public void setGoods_label(List<String> goods_label) {
            this.goods_label = goods_label;
        }

        public String getActivity_price() {
            return activity_price;
        }

        public void setActivity_price(String activity_price) {
            this.activity_price = activity_price;
        }

        public String getIs_show_contrast() {
            return is_show_contrast;
        }

        public void setIs_show_contrast(String is_show_contrast) {
            this.is_show_contrast = is_show_contrast;
        }

        public List<GoodsDetailActivity> getActivity() {
            return activity;
        }

        public void setActivity(List<GoodsDetailActivity> activity) {
            this.activity = activity;
        }

        public BannerEntity getBanner() {
            return banner;
        }

        public void setBanner(BannerEntity banner) {
            this.banner = banner;
        }

        public String getStock() {
            return stock;
        }

        public void setStock(String stock) {
            this.stock = stock;
        }

        public List<GoodsDetailSku> getSku() {
            return sku;
        }

        public void setSku(List<GoodsDetailSku> sku) {
            this.sku = sku;
        }

        public List<GoodsDetailParams> getParams() {
            return params;
        }

        public void setParams(List<GoodsDetailParams> params) {
            this.params = params;
        }

        public GoodsDetailComments getComment() {
            return comment;
        }

        public void setComment(GoodsDetailComments comment) {
            this.comment = comment;
        }

        public String getComment_count() {
            return comment_count;
        }

        public void setComment_count(String comment_count) {
            this.comment_count = comment_count;
        }
    }

    public static class GoodsDetailList extends GoodsJson.GoodsList implements MultiItemEntity {

        private int mItemType;

        //前端动态添加
        private GoodsDetailComments tempComment;
        //评论总数
        private String tempCommentCount;
        //商品详情
        private String tempGoodsContent;
        //自定义商品参数列表
        private List<GoodsDetailParams> tempParams;
        //show all expand
        private boolean isShowAllParams;

        public void setItemType(int mItemType) {
            this.mItemType = mItemType;
        }

        public void getItemType(int mItemType) {
            this.mItemType = mItemType;
        }

        public GoodsDetailComments getTempComment() {
            return tempComment;
        }

        public void setTempComment(GoodsDetailComments tempComment) {
            this.tempComment = tempComment;
        }

        public String getTempGoodsContent() {
            return tempGoodsContent;
        }

        public String getTempCommentCount() {
            return tempCommentCount;
        }

        public void setTempCommentCount(String tempCommentCount) {
            this.tempCommentCount = tempCommentCount;
        }

        public void setTempGoodsContent(String tempGoodsContent) {
            this.tempGoodsContent = tempGoodsContent;
        }

        public List<GoodsDetailParams> getTempParams() {
            return tempParams;
        }

        public void setTempParams(List<GoodsDetailParams> tempParams) {
            this.tempParams = tempParams;
        }

        public boolean isShowAllParams() {
            return isShowAllParams;
        }

        public void setShowAllParams(boolean showAllParams) {
            isShowAllParams = showAllParams;
        }

        @Override
        public int getItemType() {
            switch (mItemType) {
                case ITEM_TYPE_GOODS_COMMENT:
                case ITEM_TYPE_GOODS_WEB:
                case ITEM_TYPE_GOODS_RECOMMENT_TITLE:
                case ITEM_TYPE_GOODS_RECOMMENT_LIST:
                    return mItemType;
                default:
                    return BaseMultiItemQuickAdapter.TYPE_NOT_FOUND;

            }
        }
    }

    public static class GoodsDetailAttach {
        private String product_label;
        private String making_time;
        private String eat_time;
        private String supply_time;
        private String eat_mark;
        private String drink_time;
        private String base_wine;
        private String base_recipe;
    }

    public static class GoodsDetailActivity {
        private String activity_id;
        //活动类型 0特价 1满减 2满折 3买有送 4赠券 5限时抢购 6增积分 7门店直送 8预售 9次件折扣 10置顶
        private String activity_type;
        private String type_value;
        private String tag_name;
        private String tag_color;
        private String price;
        //规则
        private List<GoodsDetailActivityRule> rules;

        public String getActivity_id() {
            return activity_id;
        }

        public void setActivity_id(String activity_id) {
            this.activity_id = activity_id;
        }

        public String getActivity_type() {
            return activity_type;
        }

        public void setActivity_type(String activity_type) {
            this.activity_type = activity_type;
        }

        public String getType_value() {
            return type_value;
        }

        public void setType_value(String type_value) {
            this.type_value = type_value;
        }

        public String getTag_name() {
            return tag_name;
        }

        public void setTag_name(String tag_name) {
            this.tag_name = tag_name;
        }

        public String getTag_color() {
            return tag_color;
        }

        public void setTag_color(String tag_color) {
            this.tag_color = tag_color;
        }

        public String getPrice() {
            return price;
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public List<GoodsDetailActivityRule> getRules() {
            return rules;
        }

        public void setRules(List<GoodsDetailActivityRule> rules) {
            this.rules = rules;
        }
    }

    public static class GoodsDetailActivityRule {
        private String id;
        private String activities_app_id;
        //条件 如：满减： 满500元 减 95元 ；满折：满3件 ，打95折；买送：买3件 送1件
        private String condition;
        private String result;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getActivities_app_id() {
            return activities_app_id;
        }

        public void setActivities_app_id(String activities_app_id) {
            this.activities_app_id = activities_app_id;
        }

        public String getCondition() {
            return condition;
        }

        public void setCondition(String condition) {
            this.condition = condition;
        }

        public String getResult() {
            return result;
        }

        public void setResult(String result) {
            this.result = result;
        }
    }

    public static class GoodsDetailSku implements Serializable {
        private String id;
        private String goods_id;
        private String name;
        private String value;
        //sku库存
        private String stock;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getGoods_id() {
            return goods_id;
        }

        public void setGoods_id(String goods_id) {
            this.goods_id = goods_id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getStock() {
            return stock;
        }

        public void setStock(String stock) {
            this.stock = stock;
        }
    }

    public static class GoodsDetailParams {
        private String goods_id;
        private String name;
        private String value;

        public String getGoods_id() {
            return goods_id;
        }

        public void setGoods_id(String goods_id) {
            this.goods_id = goods_id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }

    public static class GoodsDetailComments {
        private String fans_id;
        private String username;
        private String avatar;
        private List<String> skill;
        private String score;
        private String content;
        private String like_count;
        private String is_like;
        private String created_at;
        //雷达图
        private String radar_map_url;
        //雷达图评分数据
        private List<GoodsCommentJson.GoodsCommentRadar> radar;

        public String getFans_id() {
            return fans_id;
        }

        public void setFans_id(String fans_id) {
            this.fans_id = fans_id;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        public List<String> getSkill() {
            return skill;
        }

        public void setSkill(List<String> skill) {
            this.skill = skill;
        }

        public String getScore() {
            return score;
        }

        public void setScore(String score) {
            this.score = score;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getLike_count() {
            return like_count;
        }

        public void setLike_count(String like_count) {
            this.like_count = like_count;
        }

        public String getIs_like() {
            return is_like;
        }

        public void setIs_like(String is_like) {
            this.is_like = is_like;
        }

        public String getCreated_at() {
            return created_at;
        }

        public void setCreated_at(String created_at) {
            this.created_at = created_at;
        }

        public String getRadar_map_url() {
            return radar_map_url;
        }

        public void setRadar_map_url(String radar_map_url) {
            this.radar_map_url = radar_map_url;
        }

        public List<GoodsCommentJson.GoodsCommentRadar> getRadar() {
            return radar;
        }

        public void setRadar(List<GoodsCommentJson.GoodsCommentRadar> radar) {
            this.radar = radar;
        }
    }
}
